package vo;

import daoFactory.DaoFactory;

public class Good extends PetObject {
    private String gid;
    private String gName;
    private String catID;
    private String gMsg;
    private String gsrc;
    private double gPrice;
    private int Gnum;
    private String cateName;

    public Good() {
    }

    public Good(Good good) {
        this.setGid(good.getGid());
        this.setCatID(good.getCatID());
        this.setgMsg(good.getgMsg());
        this.setgName(good.getgName());
        this.setgPrice(good.getgPrice());
        this.setGsrc(good.getGsrc());
        this.setGnum(good.getGnum());
        cateName = DaoFactory.getCategoryFactory().get(catID).getCatName();
    }
    
    public String getCategoryName() {
    	return cateName;
	}

	public int getGnum() {
		return Gnum;
	}

	public void setGnum(int gnum) {
		Gnum = gnum;
	}

	public String getGid() {
        return gid;
    }

    public void setGid(String gid) {
        this.gid = gid;
    }

    public String getgName() {
        return gName;
    }

    public void setgName(String gName) {
        this.gName = gName;
    }

    public String getCatID() {
        return catID;
    }

    public void setCatID(String catID) {
        this.catID = catID;
        cateName = DaoFactory.getCategoryFactory().get(catID).getCatName();
    }

    public String getgMsg() {
        return gMsg;
    }

    public void setgMsg(String gMsg) {
        this.gMsg = gMsg;
    }
    
    public String getGsrc() {
		return gsrc;
	}

	public void setGsrc(String gsrc) {
		this.gsrc = gsrc;
	}

	public double getgPrice() {
        return gPrice;
    }

    public void setgPrice(double gPrice) {
        this.gPrice = gPrice;
    }

	public String getCateName() {
		return cateName;
	}

	public void setCateName(String cateName) {
		this.cateName = cateName;
	}

	@Override
	public String toString() {
		return "Good [gid=" + gid + ", gName=" + gName + ", catID=" + catID + ", gMsg=" + gMsg + ", gsrc=" + gsrc
				+ ", gPrice=" + gPrice + ", Gnum=" + Gnum + "]";
	}
    
}
